<template>
	<view v-if="status=='0'">
	                <view class="container">
	                        <view>哈密瓜，新疆维吾尔自治区哈密地区特产，中国国家地理标志产品。
	                                哈密瓜主产于吐哈盆地（即吐鲁番盆地和哈密盆地的统称），它形态各异，风味独特，瓜肉肥厚，清脆爽口。哈密瓜营养丰富，含糖量最高达21%。哈密的甜瓜在东汉永平年间就成为进贡的异瓜种了。至清代，被哈密王作为贡品，受康熙赏赐而得名哈密瓜。时哈密瓜“往年进贡”、“瓜莫盛于哈密”、“瓜则充贡品者真出哈密”。追根溯源，哈密瓜却源于吐鲁番鄯善县一带。
	                                哈密瓜的品种资源很丰富。按成熟期不同，分早熟、中熟和晚熟品种。早、中熟的称为夏瓜，晚熟的称为冬瓜。早熟的品种主要有黄旦子、纳西甘、一包糖、包孜可口奇、石甜401等，其特点是皮薄肉细，香味浓郁。中熟品种主要有红心脆多汁、肉厚细腻、清香爽口而博得人们喜爱。晚熟品种主要有黑眉毛密极干、青麻皮密极干、炮台红、青皮红肉、青皮冬瓜、黄皮白肉可口奇等。“黑眉毛”、“青麻皮”的特点是瓜肉呈淡青色，储藏后肉质由脆硬，逐渐变得绵软多汁、甜爽而又醇香。
	                        </view>
							<view>
								西瓜是一年生藤本植物，果期在5月～9月之间，果实为球状或椭圆状，外皮有条纹，果肉为红色，种子为黑色。西瓜含有丰富的营养物质，果肉可解渴、降暑和润喉，瓜皮可治疗水肿和口腔溃疡，种子通润肠道，可治疗咳血和肠胃不适。
							</view>
	                </view>
	        </view>
	<view class="container" v-else-if="status==1">
		<swiper class="banner-swiper" circular autoplay :interval="5000" :duration="1000">
			<swiper-item class="banner-swiper-item" v-for="(item, index) in swipers" :key="index">
				<image v-if="item" :src="item" mode="widthFix"></image>
			</swiper-item>
		</swiper>
		<view class="content">
			<!-- section-1 begin -->
			<view class="section-1">
					<view class="item" @click="jump_to('配送')">
						<image src="../../static/images/my/jf.png" mode="widthFix"></image>
						<view class="wenyue-font">我的订单</view>
					</view>
					<view class="item" @click="jump_to('店内就餐')">
						<image src="/static/images/home/ts.png" mode="widthFix"></image>
						<view class="wenyue-font">店内就餐</view>
					</view>
			</view>
			<view class="coupon_btn" @click="jump_coupon">
				<image src="../../static/coupon.png" mode=""></image>
				<span>优惠券</span>
			</view>
		</view>
		<!-- 店家信息 -->
		<view class="info22">
			<view>{{shopTel}}</view>
			<view>{{shopAddress}}</view>
		</view>
		<!-- 店家信息 end -->
	</view>
	<!-- </view> -->
</template>

<script>
	export default {
		data(){
			return {
				swipers: [],
				shopTel:'0859-1234567',
				shopAddress:'福建省龙岩市新罗区xxxx街道',
				sendMethods: 2,
				status:3
			}
		},
		onLoad:function(){
			let _this=this;
			this.getBanner();
			uni.request({
				url: 'https://apiorder.wzq0307.com/api/Status/index',
				method: 'GET',
				data: {},
				success: (res) => {
					console.log(11111,res.data.data.status);
					_this.status=res.data.data.status;
						uni.setStorage('status',res.data.data.status);
				},
				fail: function(e) {
					console.log(JSON.stringify(e));
				}
			})
			// if(uni.getStorage('status')){
			// 	_this.status=uni.getStorage('status');
			// }
			// console.log(uni.getStorage('status'))
			// console.log(this.status);
		},
		methods:{
			//获取轮播图
			getBanner() {
				this.swipers = [
					"https://gimg2.baidu.com/image_search/src=http%3A%2F%2F660.zsezt.com%2Fgeneral%2Fkindeditor%2Fattached%2Fimage%2F20160710%2F20160710090533_22080.jpg&refer=http%3A%2F%2F660.zsezt.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1631170972&t=dfcf9232eccf89e505587d6e4dc0a3bc",
					"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fn.sinaimg.cn%2Fsinakd20200323ac%2F54%2Fw569h285%2F20200323%2F1e74-ireifzh7819248.jpg&refer=http%3A%2F%2Fn.sinaimg.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1631170972&t=0449af668fe01c90173e7d222222a09d"
				]
				// banner.get_banner(1).then(res => {
				// 	this.swipers = res.data.items
				// })
			},
			jump_to(type) {
				uni.setStorageSync('Dtype', type)
				if (type == '配送') {
					uni.navigateTo({
						url: '../myOrder/myOrder'
					})
				}else if(type == '店内就餐'){
					uni.navigateTo({
						url: '../index/index'
					})
				}
			},
			//跳转到优惠券页面
			jump_coupon(){
				uni.navigateTo({
					url:'../coupon/coupon?type=all'
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	page {
		// max-height: 100%;
	}
	.coupon_btn{
		display: flex;
		margin: 10px;
		// color: #FFFFFF;
		background-color: #EBEBEB;
		height: 60px;
		text-align: center;
		line-height: 60px;
		border-radius: 5px;
		font-weight: 600;
		font-size: 18px;
		align-items: center;
		justify-content: center;
		image{
			width: 30px;
			height: 30px;
			line-height: 60px;
			margin-right: 10px;
		}
	}
	.info22 {
		position: fixed;
		text-align: center;
		width: 100%;
		color: #777;
		/* #ifdef H5 */
		bottom: 90px;
		/* #endif */
		/* #ifdef MP-WEIXIN */
		bottom: 10px;
		/* #endif */
	}

	.banner-swiper {
		width: 100%;
		height: 300px;
	}

	.banner-swiper-item	image {
			width: 100%;
		}

	.content {
		width: 100%;
		padding: 0 30rpx;
		position: relative;
	}

	.section-1 {
		position: relative;
		background-color: #FFFFFF;
		margin-top: -300rpx;
		border-radius: 12rpx;
		padding: 60rpx 0;
		display: flex;
		margin-bottom: 30rpx;
		height: 370rpx;
		box-shadow: 0px 0px 3px 0px #c0c0c0;
		.item {
			flex: 1;
			flex-shrink: 0;
			display: flex;
			flex-direction: column;
			align-items: center;
			position: relative;

			&_one {
				&:nth-child(1):before {
					content: '';
					position: absolute;
					left: 0;
					top: 0;
					bottom: 0;
					width: 2rpx;
					background-color: #e5e5e5;
				}
			}

			&:nth-child(1):after {
				content: '';
				position: absolute;
				right: 0;
				top: 0;
				bottom: 0;
				width: 2rpx;
				background-color: #e5e5e5;
			}

			image {
				width: 60px;
				height: 60px;
				margin-bottom: 20rpx;
			}

			.wenyue-font {
				font-size: 48rpx;
				margin-bottom: 10rpx;
			}
		}
	}

	.section-2 {
		display: flex;
		justify-content: space-between;
		margin-bottom: 30rpx;

		.item {
			// height: 60px;
			// width: 335rpx;
			background-color: #EAEBEC;
			padding: 30rpx 0;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			border-radius: 12rpx;

			.title {
				width: 100%;
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 32rpx;

				image {
					width: 60px;
					height: 60px;
					margin-right: 10px;
				}
			}

			.tips {
				color: #999;
				font-size: 28rpx;
			}
		}
	}

	.section-3 {
		margin-bottom: 30rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-size: 28rpx;
		color: #999;
		padding: 0 10rpx;

		.my-integral {
			flex: 1;
			display: flex;
			flex-direction: column;

			.integrals {
				display: flex;
				align-items: center;
				font-size: 32rpx;
				color: #333;
				margin-bottom: 10rpx;

				.neutra-font {
					margin-left: 10rpx;
					font-size: 42rpx;
				}
			}
		}

		.my-code {
			display: flex;
			flex-direction: column;
			align-items: center;
			padding: 0 30rpx;
			position: relative;

			image {
				width: 60px;
				height: 60px;
				margin-bottom: 8rpx;
			}

			&:before {
				content: " ";
				position: absolute;
				left: 0;
				top: 0;
				bottom: 0;
				border-left: 1rpx solid #e5e5e5;
			}
		}
	}

	.info {
		position: fixed;
		bottom: 140rpx;
		left: 0;
		color: #999;
		width: 100%;
		text-align: center;
		padding-top: 80px;
		color: #777;
		font-size: 12px;

		>view {
			&:first-child {
				margin-bottom: 10rpx;
			}
		}
	}

	/* #ifdef MP-WEIXIN */
	.info {
		position: fixed;
		bottom: 40rpx;
		left: 0;
		width: 100%;
		text-align: center;
		padding-top: 80px;
		color: #777;
		font-size: 0.9rem;

		>view {
			&:first-child {
				margin-bottom: 10rpx;
			}
		}
	}

	/* #endif */
</style>
